<html>
<meta http-equiv="Content-type"content="text/html;charset=utf-8"/>
<style type="text/css">
#btn_find
{
-webkit-border-radius:4px;
-webkit-box-shadow: 0 1px 0px 1px #8B795E;
background: -webkit-linear-gradient(#836FFF, #7A67EE);
border : 0px;
color: white;
}
#btn_find:hover
{
background: -webkit-linear-gradient(#7A67EE, #6959CD);
}
</style>
<body>
<?php
if(isset($_POST["hoTen"]))
{
$hoTen = $_POST["hoTen"];
$arr = explode(" ",$hoTen);
$ho = $arr[0];
$lot = "";	
$ten = $arr[count($arr)-1];
for($i = 1; $i < count($arr)-1;$i++)
{
$lot = $lot.$arr[$i]." ";
}
}
?>
<form id="form1"name="form1"method="post"action="TachHoVaTen.php">
<table align="center"style="background-color:#FFFACD;"border="1px">
<tr>
<td style="background-color:#CDC9A5;"colspan="2"align="center">TÁCH HỌ VÀ TÊN</td>
</tr>
<tr>
<td>Họ Và Tên: </td>
<td><label><input id="hoTen"name="hoTen"type="text"value="<?php
	if(isset($_POST["hoTen"]))
	{
		echo $_POST["hoTen"];
	}
?>"/></label></td>
</tr>
<tr>
<td>Họ: </td>
<td><label><input id="ho"name="ho"type="text"value="<?php
	if(isset($_POST["ho"]))
	{
		echo $ho;
	}
?>"/></label></td>
</tr>
<td>Tên Lót: </td>
<td><label><input id="lot"name="lot"type="text"value="<?php
	if(isset($_POST["lot"]))
	{
		echo $lot;
	}
?>"/></label></td>
</tr>
<td>Tên: </td>
<td><label><input id="ten"name="ten"type="text"value="<?php
	if(isset($_POST["ten"]))
	{
		echo $ten;
	}
?>"/></label></td>
</tr>
<tr>
<td colspan="2"align="center"><label><input id="tach"name="tach"type="submit"value="tách Họ Tên"align="center"/></label></td>
</tr>
</table>
</form>



</body>
</html>